1. Field of the Invention
The present invention relates to techniques for improving computer system performance. More specifically, the present invention relates to the design of a high-speed jump-target predictor, which can be dynamically shared between processes.
2. Related Art
Advances in semiconductor fabrication technology have given rise to dramatic increases in processor clock speeds. These increasing clock speeds have significantly increased processor performance. However, as clocks speeds continue to increase, the time available to perform computational operations within each pipeline stage decreases. This causes some computational operations to require more pipeline stages, which can reduce the performance improvements gained by increasing the clock speed.
For example, as clock speeds continue to increase, it is becoming progressively harder to perform jump instructions without introducing additional pipeline stages. More specifically, a typical jump instruction causes a control transfer to a “jump target,” but the jump target is not actually calculated until the after the source registers of the jump instruction are read. This means the instruction fetch unit (IFU) has to wait to fetch the next instruction until the source registers are read and jump target is calculated. Hence, in order to avoid waiting for a jump target to be calculated, it is desirable for the IFU to be able to predict jump targets.
Some existing systems use a per-process return address stack to predict jump targets for jumps that are used to return from subroutines. Unfortunately, this type of stack cannot be shared between processes because accesses from different processes would interfere with each other. Consequently, in this type of system each process requires its own stack, which can consume a large amount of semiconductor area and can greatly increase system complexity. (The term “process” as used in this specification and the associated claims refers to any thread of execution that maintains its own program counter. Note that processes are also referred to as “threads” or “strands.”) For subroutine calls and other types of jump instructions, a program-counter-indexed target buffer is often used to predict jump targets.
Hence, what is needed is a method and an apparatus for predicting jump targets without the above-described problems.